package com.tiankun.eurekasellinfo.controller;

import com.tiankun.eurekasellinfo.pojo.Shop;
import com.tiankun.eurekasellinfo.service.ShopService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author 杨天可
 * @Date 2020/11/14 15:04
 * @Version 1.0
 */
@Controller
@RequestMapping("/shop")
public class ShopController {

    @Resource
    ShopService shopService;

    @PostMapping("/registShop")
    @ResponseBody
    public Map registShop(@RequestBody Shop shop){
        return  shopService.registShop(shop);
    }

    @PostMapping("/changeShopState")
    @ResponseBody
    public  Map changeShopState(Integer shopId,Integer state){
        return  shopService.changeShopState(shopId,state);
    }

    @RequestMapping("/selectById")
    @ResponseBody
    public  Map selectById(@RequestParam("id")Integer id){
        return shopService.selectById(id);
    }
}
